/*    */ package com.feeyin.radar.sys.dao.impl;
/*    */ 
/*    */ import com.feeyin.radar.commons.StringUtils;
/*    */ import com.feeyin.radar.sys.dao.FunctionTreeDAO;
/*    */ import com.feeyin.radar.sys.model.FunctionTree;
/*    */ import java.util.HashMap;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import org.springframework.orm.ibatis.SqlMapClientTemplate;
/*    */ import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
/*    */ 
/*    */ public class FunctionTreeDAOImpl extends SqlMapClientDaoSupport
/*    */   implements FunctionTreeDAO
/*    */ {
/*    */   public List getViewFunctions()
/*    */   {
/* 22 */     return getSqlMapClientTemplate().queryForList("getViewFunctions");
/*    */   }
/*    */ 
/*    */   public List getFunctions() {
/* 26 */     return getSqlMapClientTemplate().queryForList("getFunctions");
/*    */   }
/*    */ 
/*    */   public List getFunctionsByActivity() {
/* 30 */     return getSqlMapClientTemplate().queryForList("getFunctionsByActivity");
/*    */   }
/*    */ 
/*    */   public List getFunctionsByUserId(Integer userId) {
/* 34 */     return getSqlMapClientTemplate().queryForList("getFunctionsByUserId", userId);
/*    */   }
/*    */ 
/*    */   public FunctionTree getFunction(Integer id) {
/* 38 */     FunctionTree function = new FunctionTree();
/* 39 */     function = (FunctionTree)getSqlMapClientTemplate().queryForObject("getFunction", id);
/* 40 */     return function;
/*    */   }
/*    */ 
/*    */   public FunctionTree getFunctionByNameParentId(String functionName, Integer parentId) {
/* 44 */     Map map = new HashMap();
/* 45 */     map.put("functionName", functionName);
/* 46 */     map.put("parentId", parentId);
/*    */ 
/* 48 */     FunctionTree function = new FunctionTree();
/* 49 */     function = (FunctionTree)getSqlMapClientTemplate().queryForObject("getFunctionByNameParentId", map);
/* 50 */     return function;
/*    */   }
/*    */ 
/*    */   public boolean insertFunction(FunctionTree function) {
/* 54 */     Integer result = (Integer)getSqlMapClientTemplate().insert("insertFunction", function);
/* 55 */     return result != null;
/*    */   }
/*    */ 
/*    */   public boolean updateFunction(FunctionTree function)
/*    */   {
/* 60 */     Integer result = Integer.valueOf(getSqlMapClientTemplate().update("updateFunction", function));
/* 61 */     return result != null;
/*    */   }
/*    */ 
/*    */   public boolean updateFunctionByFunctionNameEn(String functionNameEn, String status)
/*    */   {
/* 66 */     if (StringUtils.isEmpty(functionNameEn)) return false;
/* 67 */     if (StringUtils.isEmpty(status)) return false;
/* 68 */     Map map = new HashMap();
/* 69 */     map.put("functionNameEn", functionNameEn);
/* 70 */     map.put("isActivity", status);
/* 71 */     Integer result = Integer.valueOf(getSqlMapClientTemplate().update("updateFunctionByFunctionNameEn", map));
/* 72 */     return result != null;
/*    */   }
/*    */ 
/*    */   public boolean updateFunctionByFunctionCode(String functionCode, String status)
/*    */   {
/* 78 */     if (StringUtils.isEmpty(functionCode)) return false;
/* 79 */     if (StringUtils.isEmpty(status)) return false;
/* 80 */     Map map = new HashMap();
/* 81 */     map.put("functionCode", functionCode);
/* 82 */     map.put("isActivity", status);
/* 83 */     Integer result = Integer.valueOf(getSqlMapClientTemplate().update("updateFunctionByFunctionCode", map));
/* 84 */     return result != null;
/*    */   }
/*    */ 
/*    */   public boolean deleteFunction(Integer id)
/*    */   {
/* 89 */     Integer result = Integer.valueOf(getSqlMapClientTemplate().delete("deleteFunction", id));
/* 90 */     return result != null;
/*    */   }
/*    */ 
/*    */   public boolean deleteFunctionByParentId(Integer parentId)
/*    */   {
/* 95 */     Integer result = Integer.valueOf(getSqlMapClientTemplate().delete("deleteFunctionByParentId", parentId));
/* 96 */     return result != null;
/*    */   }
/*    */ }

/* Location:           C:\Users\e547415\MyProject\rone\WEB-INF\classes\
 * Qualified Name:     com.feeyin.radar.sys.dao.impl.FunctionTreeDAOImpl
 * JD-Core Version:    0.6.0
 */